Unit. 5 -- Common Modeling Situations

 

homegrn.gif (269 bytes) back_arrow.gif (267 bytes)forward_arrow.gif (266 bytes)


The Four-Step Design Method for Design a Fact Table

1. Step 1: Choosing the data mart

 

2. Step 2: Deside the fact table grain

            - The lower the level of granularity, the more robust the design

             - Easily handle unexpected queries and additional new data elements

           - Individual transaction level

               . Each sales transaction

                       . Each insurance claim

                       . Each ATM transaction

            - Individual snapshot level

                      . Each daily product sales total in each store

                      . Each monthly account snapshot

            - Line_item level

                    . Each line-item on each order(shipment's invoice)

                    . Each coverage in each individual insurance level

 

3. Step 3: Choosing the dimensions

        Example:     Fact: Month level

                            Time dimension: can be year, but not daily level

 

4. Step 4: Choose the facts


Families of Fact Table

Reason 1: Supply Chains, Value Chains, Value Circles

Multiple fact tables are needed to support a business with many processes. Each process spawns one or more fact tables.

   A product moves from the acquisition of raw materials through to the finished good.

    After a product enters finished goods inventory in a warehouse, it is thought of as being part of the demand chain, or value chain.

    In other kind of business, all the entities may be performing or measuring the same kind of transaction,

 

Reason 2: Heterogeneous Product Schemas

Multiple fact tables are needed when a business has heterogeneous products that have naturally different facts but a single customer base.

corefacttable.gif (6212 bytes)

customfact.gif (10909 bytes)

Reason 3: Transactions and Snapshot Schemas

        -  Transactions fact table is usually built first

transaction.gif (9103 bytes)

      

  -  Snapshot fact tables capture the periodic snapshots.

SNAPSHOT.GIF (8507 bytes)

Reason 4: Aggregates

 


Factless Fact Tables

        - Example: When a salesperson didn't get an order

        - Example: Record student attendance of classes

FACTLESS.GIF (13416 bytes)

factlesspromotion.gif (11241 bytes)

        - Use it when a primary fact table is sparse

        - Regular sales fact table cannot answer: Which products on promotion did not sell?

        - The coverage fact table will contain a row for each item on promotion

        - Query processing of the above query:

             . Find list of products in promotion from the coverage fact table

            . MINUS

            . Find the list of products that did sell

            . Perform MINUS

        - The coverage tables avoids storing explicit zeroes


HOMEGRN.GIF (269 bytes) back_arrow.gif (267 bytes)forward_arrow.gif (266 bytes)